import { useState, useRef } from 'react'

function App() {
  const [value, setValue] = useState('这是什么,清春啊')
  const inputRef = useRef(null)

  function showDom() {
    console.log(123, inputRef.current);
  }

  return (
    <div >
      <h1>react组件 10</h1>
      <input placeholder='你好' ref={inputRef} value={value} onChange={e => setValue(e.target.value)} />
      <button onClick={showDom}>点击获取dom</button>
    </div>
  )
}

export default App
